const request = {
	/**
	 * 总属性
	 * ajax只是为了更加方便的增加属性比如headers
	 */
	ajax: (url,data,method="get",header={})=>{
		return new Promise((resolve,reject)=>{
			uni.request({
				url,
				method,
				data,
				header: header
				success: (res)=>{
					successFn(res);
				},
				fail: (err)=>{
					successFn(err);
				}
			})
		})
	},
	post: (url,data,header={})=>{
		return this.ajax(url,data,"post",header)
	},
	get: (url,data,header={})=>{
		return this.ajax(url,data,"get",header)
	},
}

/*
用法
request.post("xxx",{}).then(res=>{
	
}).catch(err=>{
	
})

*/
export default request